package io.renren.modules.weixin.Service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;
import io.renren.modules.weixin.Service.ZbResultService;
import io.renren.modules.weixin.dao.ZbResultDao;
import io.renren.modules.weixin.entity.ComputeEntity;
import io.renren.modules.weixin.entity.ZbResultEntity;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author: Mr-wang
 * @date: 2018/4/19 0019 21:45
 * @Description:
 */
@Service("zbResultService")
public class ZbResultServiceImpl extends ServiceImpl<ZbResultDao, ZbResultEntity> implements ZbResultService{


    @Override
    public PageUtils queryPage(Map<String, Object> params) {

        String zbName = (String)params.get("zbName");

        Page<ZbResultEntity> page = this.selectPage(
                new Query<ZbResultEntity>(params).getPage(),
                new EntityWrapper<ZbResultEntity>()
                    .like(StringUtils.isNotBlank(zbName),"zb_name",zbName)
        );
        return new PageUtils(page);
    }

    @Override
    public List<ZbResultEntity> selectzb() {
        return baseMapper.selectzb();
    }

    @Override
    public List<ZbResultEntity> selectLineByZbCode(String zbCode) {
        return baseMapper.selectLineByZbCode(zbCode);
    }

    @Override
    public ComputeEntity selectByZbCode(String zbCode) {
        return baseMapper.selectByZbCode(zbCode);
    }

    @Override
    public void checkZbValue(ZbResultEntity zbResultEntity) {

    }

}